package com.group9.util;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
//	public static String app_id = "2016102400751425";
//	public static String app_id = "2021001164613567";
	public static String app_id = "2016102100733357";

	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCYTKgHrPYqdOqBbIyWDpITGeBb279NVTwJoqTxNT7jfM6UjxwTvkB2UEHSLpZxrgKIXd1CrCQaTzql5MirtbpNSM6SE+jC6kc96nEMWAK2dfx6F31o6LH8jx2hBPuLJB7uvfNk911mwsdjgZSqSJYy/HuYTr8vguKWqG4PqbM9gF1wH0Q452X85uHO7o3trrUdZUXchenPqa6WxAKk6nm7CHJMSEfR8G4hA+VMeAaF5Yx3yIED6cAvWjjQwth+t3rz4WCntmEsUDvWwNUriwxq9TNXA4IAVZR8KextZ5AoLHs52xfR20tvnMMC9jjk0IGk1sZ2O8gqi71q/ixFJ66DAgMBAAECggEBAI9Aq1xs6C8PQfTy8VnD4spssIg2rj5DSfGWNqdbegfoQTejVLmNXnzrCL52a7QKBP/XqmMoH91PYM7h348DpHVFYmgsqeeNDe3DMwp1Tjfpys3cgm3HUoNI6ommciRymVXe/a2erxAVbg6+t+Nj20OiEW81wschyZgEXWIGMT5KpnobXUj+pZu9jhwm6GU7XW0BBoCo50yqtt6cxpupzJxOJr75blx55Mf8JcdRUuhlihXPY9BPL6vEq00Uqi4fWYPq4Xz8svGnCyqikqYFqzIZEs0aXCCVGw87lPtSybDD1Wc13yX5i9RDcNB3NcgA2tetVL81XFxsm8OfKBlGZKECgYEA2QoGtldC148ys5mzLPaLUIgZH1IuBiq/ZL252eFvkP35NPxRk9p2XO2kQxoX2+DQNldl6wF6GPARgr2P/Sj/t9/q8PFrfy+9+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yYY5KNaoiuGXore7VusgBAZK2djiIshXX59ZplzxRaSzulJ9XnKxKAJ93oxH0xqKPrrFl5Vb0CgYA2VmqlFI0aovVJnAadWAmLOWKCVZnkhc4qUjoAuVymAwQHJbAOtx7fsbMAaEmtaQaQkljkGbKaM4K+psAvt2hf/YNp0XX4kS8IaJTdHlYihljsUn2zuieOChc3hKq6mY8YDd+bMmyq08h1saGRkTCnWVwGgr+sJjcfb2roY84iXw==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnPymLWd63QFEe2Z+DcUs4dYW7mFHA3T50c7u0qq6lahvAC2KiPJmJFtEt++o28W7r/8XHGKOzEQyJa1ZiojSqTjZn8oLtVAGMhvSrCRbByR0G1xp/BBVPjIiAalCPNTix8tP9W8u7oqqN0zRx+Fhc+UjhAq65B9wLN7HCQus9J0GDv3NXccWN7ipmbQXWgvEXJDbyAej0RNIsn/rqkk/VZrY+g7KRCE855vDzuXbghtqK2AY/NbGFeuhle4Tvy0Uiw1VcUbCl96YJr6stSIHZPpznWS6T8mUv21PxsrjdDyFSVJcWqe0+nEdy5VfmmBVZBgsoQ/KESRNQeSVRPqtcQIDAQAB";
//    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnp9OwHs1zKtBwoQGIpaQTuT2CnLtdUv2sTxpDWNHEg+v4shKCLA+9TaPQq41oAFRpejzMEfs2WL/eUBJIoMbOE6mokdJn95qLH24TND4konBifDgXoHcgW+Nll2tMcW4MrBFDT5rJRHyj2MfnvUJYZDwatF1H46/ZoMwwiFMyNxhdusdk1kIoxqfWqvaIBO2UO/eOqFFy/TvRN+cM4OeCsQ1nqCXq6UlJRyIFyfGsSZz8Nvq5lK7JdBMPQUEo03WL3xl56NdGCQQzKaKBtM06uR8oBRvnEtDyjyKDP+kqQCS0sfuXt56EhchyfZ9G47u3GoV8ZANIOq2PtpkuYSeCwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8888/first_page.html";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8888/fruit_order.html";

	// 签名方式
	public static String sign_type = "RSA2";

	// 字符编码格式
	public static String charset = "utf-8";

	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

